<template>
	<view class="flex-col page">
		<view class="flex-col flex-auto group space-y-24">
			<view class="flex-row justify-start items-start section_3">
				<view class="flex-col justify-start items-center image-wrapper" v-for="(item,index) in list" :key="index">
					<image class="image_5" :src="item" />
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		onShow,
		onLoad
	} from "@dcloudio/uni-app";
	import {
		onMounted,
		ref,
		reactive,
		getCurrentInstance
	} from "vue"
	const {
		proxy
	} = getCurrentInstance()
	let shop_id = ref('')
	let type = ref(1)
	let title = ref('')
	let content = ref({})
	let list = ref([])
	onLoad((option)=>{
		type.value=option.type
		shop_id.value=option.shop_id
		if(type.value==1){
			uni.setNavigationBarTitle({
				title: '资质证明'
			});
		}else if(type.value==2){
			uni.setNavigationBarTitle({
				title: '其他资质证照图'
			});
		}
		getDate()
	})
	const getDate = () => {
		proxy.$req.requestPOST(proxy.$api.ShopInfo.getDetail, {
			shop_id:shop_id.value,
			member_id:uni.getStorageSync('member_id')
		}).then(res => {
			if (res.flag == "success") {
				content.value = res.data
				if(type.value==2){
					content.value.other_license.forEach(ele=>{
						list.value.push(ele.abs_url)
					})
				}else if(type.value==1){
					list.value.push(content.value.license)
				}
				console.log(list.value);
			}
		})
	}
</script>

<style scoped lang="scss">
	.page {
		background-color: #fff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100vh;

		.group {
			// padding-top: 40rpx;
			overflow-y: auto;

			.text_4 {
				color: #a3a3a3;
				font-size: 28rpx;
				font-family: PingFang SC;
				line-height: 28rpx;
				padding: 40rpx 31rpx;
				width: 100%;
				background-color: #f8f8f8;
			}

			.section_3 {
				margin-top: 30rpx;
				padding: 0rpx 0 22rpx;
				background-color: #ffffff;

				.image-wrapper {
					margin-left: 58rpx;
					// padding: 18rpx 0;
					background-color: #f2f2f2;
					border-radius: 20rpx;
					width: 275rpx;
					height: 275rpx;
					border: solid 1rpx #f0f0f0;

					.image_5 {
						width: 275rpx;
						height: 275rpx;
					}
				}
			}
		}

		.space-y-24 {

			&>view:not(:first-child),
			&>text:not(:first-child),
			&>image:not(:first-child) {
				margin-top: 24rpx;
			}
		}
	}
</style>